package com.itheima;

/**
 * 2025/5/15 8:09
 */
public class TestA {
    public static void main(String[] args) {
        //写出A接口的匿名内部类
        A a1 = new A(){
            @Override
            public void show(String name, int age) {
                System.out.println("匿名内部类重写show方法");
            }

        };
        //改成Lambda表达式
        A a2 = (name, age) ->System.out.println(age+"匿名内部类重写show方法"+name);

        //改成方法引用的写法
        A a3 = TestA::show;
        a3.show("李四", 19);

    }

    public static void show(String name,int age){
        System.out.println(name+"show方法"+age);
    };
}
